home *** CD-ROM | disk | FTP | other *** search
- Path: news.ucalgary.ca!krawchuk
- From: krawchuk@ensu.ucalgary.ca (Mike Krawchuk)
- Newsgroups: comp.lang.c++
- Subject: Crappy or what? Oualline's C++ book
- Date: 15 Feb 1996 17:28:09 GMT
- Organization: Dis
- Distribution: world
- Message-ID: <KRAWCHUK.96Feb15102809@survey.ensu.ucalgary.ca>
- NNTP-Posting-Host: @survey.ensu.ucalgary.ca
-
- An instructor in our department asked me to verify some suspicions he
- had about a book he was considering using as a text - Practical C++
- Programming, by Steve Oualline, published by O'Reilly & Associates Inc.
-
- After reading through it, I came to the conclusion that it is unusable.
- It is filled with typographical errors, errors of fact, and broken code.
-
- As one example, the section on constant pointers (p. 232) is exactly
- wrong in its use of const to modify pointers. The code labelled
- incorrect compiles under gcc and Borland C++; the code labelled correct
- causes compiler errors. (as additional verification, Stroustrup's C++
- Programming Language also verifies that Oualline is wrong, pp. 68-9)
-
- The code provided is:
-
- const char *answer_ptr = "Forty-Two";
-
- answer_ptr = "Fifty-One"; // Oualline says illegal; Stroustrup, gcc says OK
- *answer_ptr = 'X'; // Oualline says legal; Stroustrup, gcc says illegal
-
- This is not the only glaring error in the book. Are we the only ones to
- have noticed these errors, or is there some subtle trick we are missing?
- The O'Reilly web site doesn't have errata for the book, but I can't
- believe everyone else has passed over them! (we're very disappointed,
- as we've used many O'Reilly books in classes before.)
-
- Mike
-